package com.hectopascal.goalance.service;

import com.hectopascal.goalance.pojo.SystemSetting;
import com.hectopascal.goalance.repository.SystemSettingRepository;
import com.hectopascal.goalance.service.Ipml.ISystemSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemSettingService implements ISystemSettingService {
    @Autowired
    SystemSettingRepository systemSettingRepository;

    @Override
    public List<SystemSetting> systemSettingGet() {
        return systemSettingRepository.findSystemSettingById().get();
    }

    @Override
    public int systemSettingUpdate(SystemSetting systemSetting) {
        int rows=systemSettingRepository.updateSystemSetting(systemSetting.getApprovalTimeout(),systemSetting.getId());
        return rows;
    }
}
